import socket

sock =  socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('', 50000))
sock.listen(5)

while True:
    addr, conn = sock.accept()
    print addr, conn
